/*****************************************************************//**
 * \file   AnsysAPDLReader_EBLOCK.h
 * \brief  AnsysAPDLReader_EBLOCK
 *
 * \author Wyatt
 * \date   May 2023
 *********************************************************************/
#pragma once

#include "AnsysAPDLReaderBase.h"
#include "AnsysDataDef.h"

class AnsysAPDLReader_EBLOCK : public ReaderBase
{
	DECLARE_CDB_READER(AnsysAPDLReader_EBLOCK)

public:
	AnsysAPDLReader_EBLOCK(CDBReader* pCDBReader);
	virtual ~AnsysAPDLReader_EBLOCK(void) {}

	std::vector<int> _elementIdRead;

protected:
	int _elemCnt = 0;
	bool _bSolid = false;
	int _nNodesNum = 0;
	int _nLine = 1;
	bool _bNextLine = false;

	//AnsysPropTup _prop;
	//AnsysElem _elem;

	AnsysElement _elem;

public:
	bool Scan(std::string& strDataLine);
	bool Read(std::string& strDataLine);
	AnsysElement get_elem() { return _elem; }
protected:
	bool ScanHead(std::string& strDataLine);
	bool ScanData(std::string& strDataLine);
	bool ReadHead(std::string& strDataLine);
	bool ReadData(std::string& strDataLine);

};

static AnsysElement tempNodeElement;

class AnsysAPDLReader_TYPE : public ReaderBase
{
	DECLARE_CDB_READER(AnsysAPDLReader_TYPE)

public:
	AnsysAPDLReader_TYPE(CDBReader* pCDBReader);
	virtual ~AnsysAPDLReader_TYPE(void) {}

public:

	virtual bool Read(std::string& strDataLine);
};

class AnsysAPDLReader_MAT : public ReaderBase
{
	DECLARE_CDB_READER(AnsysAPDLReader_MAT)

public:
	AnsysAPDLReader_MAT(CDBReader* pCDBReader);
	virtual ~AnsysAPDLReader_MAT(void) {}

public:

	virtual bool Read(std::string& strDataLine);
};

class AnsysAPDLReader_REAL : public ReaderBase
{
	DECLARE_CDB_READER(AnsysAPDLReader_REAL)

public:
	AnsysAPDLReader_REAL(CDBReader* pCDBReader);
	virtual ~AnsysAPDLReader_REAL(void) {}

public:

	virtual bool Read(std::string& strDataLine);
};

class AnsysAPDLReader_TSHAPE : public ReaderBase
{
	DECLARE_CDB_READER(AnsysAPDLReader_TSHAPE)

public:
	AnsysAPDLReader_TSHAPE(CDBReader* pCDBReader);
	virtual ~AnsysAPDLReader_TSHAPE(void) {}

public:

	virtual bool Read(std::string& strDataLine);
};

class AnsysAPDLReader_EN : public ReaderBase
{
	DECLARE_CDB_READER(AnsysAPDLReader_EN)

public:
	AnsysAPDLReader_EN(CDBReader* pCDBReader);
	virtual ~AnsysAPDLReader_EN(void) {}

public:

	virtual bool Read(std::string& strDataLine);
};